package com.itheima.reggie.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.itheima.reggie.dto.DishDto;
import com.itheima.reggie.pojo.Dish_菜品;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @Author: cl
 * @Date: 2022/4/3 - 04 - 03
 * @Description:
 */
public interface DishMapper extends BaseMapper<Dish_菜品> {

    //自定义批量修改
    @Update("<script>update dish set status =#{status} where  id in " +
            "<foreach collection = 'ids' item ='id' open='(' close=')' separator=','>#{id}</foreach></script>")
    void updateStatus(int status, @Param("ids") long[] ids);


    //自定义分页查询
    List<DishDto> search(String name);
}
